{% extends "view/admin/ext_admin.html" %}
{% block extadmin %}
    <section class="panel panel-default">
        <div class="panel-body">
            <form id="ajaxForm" method="post" class="form-horizontal" action="/{{ctx.controller}}/addapi" data-validate="parsley">
                <div class="form-group">
                    <label class="col-sm-2 control-label">接口标识</label>

                    <div class="col-sm-10">

                        <div class="row">
                            <div class="col-md-4">
                                <input type="text" class="form-control  " name="name" value="{{ info.name }}" disabled>
                            </div>
                            <div class="col-md-12">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle text-info"></i> 字母或字母数字组合，会根据该标识自动建表，如：<code>cmswing_ext_collector_标识</code></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">接口名称</label>

                    <div class="col-sm-10">
                        <div class="row">
                            <div class="col-md-4">
                                <input type="text" class="form-control  " name="title" value="{{ info.title }}" data-required="true" >
                            </div>
                            <div class="col-md-12">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle text-info"></i> 接口名称</span>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">所属模型</label>

                    <div class="col-sm-10">
                        <div class="row">
                            <div class="col-md-4 ">
                                <select class="form-control " name="model">
                                    {% for m in modellist %}
                                    <option value="{{ m.name }}" {{ 'selected' if info.model == m.name }}>{{ m.title }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                            <div class="col-md-12">
                                <span class="help-block m-b-none text-muted"><i class="fa fa-info-circle text-info"></i> 根据该模型选择采集入库字段</span>

                            </div>

                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">备注说明</label>

                    <div class="col-sm-10">
                        <div class="row">
                            <div class="col-md-4 ">
                                <textarea class="form-control parsley-validated" rows="6"   placeholder="Type your info" name="info"></textarea>
                            </div>
                            <div class="col-md-12">
                                <span class="help-block m-b-none"></span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group form-submit">
                    <div class="col-sm-4 col-sm-offset-2">
                        <input type="hidden" name="id" value="{{ info.id }}">
                        <button class="btn btn-primary btn-s-md ajax-post" type="submit" target-form="form-horizontal">确定</button>
                        <button class="btn btn-default" onclick="javascript:history.back(-1);return false;"
                                type="submit">返回
                        </button>

                    </div>
                </div>
            </form>
        </div>
    </section>
{% endblock %}
